<!DOCTYPE html PUBLIC "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd>
<html>
	<head>
		<link rel="stylesheet" type="test/css" href="css/pageacceuil.css"/>
		<link rel="stylesheet" type="test/css" href="css/reset.css"/>
		<title> FreeBED project </title>
		<meta charset= "UTF-8" />
	</head>
	
	<body>
		<div id="header">
			<header class="background_alpha">
				<center><h1>FreeBED</h1></center>
			</header>
			<hr/>
		</div>
		
		<center>
			<div id="menu" class="border background_alpha">
				<div id="login">
					<?php
						if(isset($infos))
						{
							echo "<a href='freebed-logout.php'>Deconnexion</a>";
						}
						else
						{
							echo "<a href='freebed-login.php'>Login</a> ";
							echo "<a href='freebed-register.php'>S'enregistrer</a>";
						}
					?>
				</div>
				<div id="search" style="margin-top: 5px;">
					<a href="freebed-search.php">Recherche Avancée</a>
				</div>
			</div>	
			<div id="conteneur" class="border background_alpha">
				<div id="profil" class="border">
					<?php
						if(isset($infos))
						{
							echo "<img src='$infos[3]' style='margin-top: 150px; margin-bottom: 5px; width:150px; height:150px;'/>";
							echo "<p>Bienvenue, $infos[0] $infos[1]</p><br/>";
							if($infos[2] == 0)
								echo "<p>Status : Utilisateur</p>";
							else
							{
								echo "<p>Status : Bailleur</p>";
								echo "<p>Nombre de biens en ligne : $infos[4]</p>";
								echo "<br/><a href='freebed-panel.php'>Voir / Modifiez vos biens</a>";
							}
							echo "<br/><a href='freebed-add.php'>Mettre un bien en ligne</a>";
							echo "<br/><a href='freebed-moduser.php'>Modifier votre profil</a>";
						}
						else
						{
							$id_ville = $data['id_ville'];
							$ville = mysqli_fetch_array(mysqli_query($bdd, "SELECT libelle FROM ville WHERE id='$id_ville'"))[0];
							
							//Image query
							$image = mysqli_fetch_array(mysqli_query($bdd, "SELECT path FROM photos WHERE id_bien='$data[0]'"))[0];
							
							echo "<div style='display: inline-block; padding-right: 30px; margin-top: 100px;'>";
							echo "<p>Dernier bien ajouté : </p><br/>";
							echo "<img style='width: 150px; height: 150px;' src='$image'/><br/><br/>";
							echo "<p>$data[5]</p>";
							echo "<p>$data[6]</p>";
							echo "<p>$ville</p>";
							echo "</div>";
						}
					?>
				</div>
				<div id="offre" class="border">
					<h2 style="margin-top: 25px;">Bienvenue sur FreeBed</h2>
					<br/>
					<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed aliquam id velit ac cursus. Ut posuere purus arcu, facilisis rhoncus neque aliquet eget. Curabitur at pretium orci. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus vitae est ac arcu condimentum pharetra nec id dui. Mauris scelerisque, risus nec ornare hendrerit, elit lorem facilisis turpis, eu ultricies urna orci et lacus. Donec tortor lectus, rhoncus ac accumsan vel, consequat vel neque. Phasellus sit amet tempor purus. Aenean at posuere dolor. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Quisque fermentum metus elit, ac fermentum mi pharetra sit amet. Pellentesque id justo ligula. Praesent vel volutpat massa, sit amet varius magna. Nam mollis erat venenatis erat luctus, nec hendrerit nisi lobortis. Maecenas facilisis, tellus ac gravida feugiat, felis sem porttitor justo, a tincidunt est arcu a lorem.</p><br/><br/>
					<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed aliquam id velit ac cursus. Ut posuere purus arcu, facilisis rhoncus neque aliquet eget. Curabitur at pretium orci. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus vitae est ac arcu condimentum pharetra nec id dui. Mauris scelerisque, risus nec ornare hendrerit, elit lorem facilisis turpis, eu ultricies urna orci et lacus. Donec tortor lectus, rhoncus ac accumsan vel, consequat vel neque. Phasellus sit amet tempor purus. Aenean at posuere dolor. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Quisque fermentum metus elit, ac fermentum mi pharetra sit amet. Pellentesque id justo ligula. Praesent vel volutpat massa, sit amet varius magna. Nam mollis erat venenatis erat luctus, nec hendrerit nisi lobortis. Maecenas facilisis, tellus ac gravida feugiat, felis sem porttitor justo, a tincidunt est arcu a lorem.</p><br/><br/>
					<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed aliquam id velit ac cursus. Ut posuere purus arcu, facilisis rhoncus neque aliquet eget. Curabitur at pretium orci. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus vitae est ac arcu condimentum pharetra nec id dui. Mauris scelerisque, risus nec ornare hendrerit, elit lorem facilisis turpis, eu ultricies urna orci et lacus. Donec tortor lectus, rhoncus ac accumsan vel, consequat vel neque. Phasellus sit amet tempor purus. Aenean at posuere dolor. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Quisque fermentum metus elit, ac fermentum mi pharetra sit amet. Pellentesque id justo ligula. Praesent vel volutpat massa, sit amet varius magna. Nam mollis erat venenatis erat luctus, nec hendrerit nisi lobortis. Maecenas facilisis, tellus ac gravida feugiat, felis sem porttitor justo, a tincidunt est arcu a lorem.</p><br/><br/>
				</div>
			</div>
		</center>
			
		<center>
			<div id="footer" class="border background_alpha">
				<center>&copy; Poney</center>
			</div>
		</center>
	</body>
</html>
